package cool.mtc.base.plugin.generator.code.model.template.bg;

import cool.mtc.core.util.StringUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author 明河
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class BgServiceTemplateParam extends BaseBgTemplateParam {

    @Override
    public String getTemplateRelativePath() {
        return "bg/service.ftl";
    }

    @Override
    public String getBasePackage() {
        return this.getServiceBasePackage();
    }

    @Override
    public String getClassName() {
        return this.getClassPrefix() + "Service";
    }

    @Override
    public void handleCheckParamsCorrect() {
        super.handleCheckParamsCorrect();
        if (StringUtil.isEmpty(this.getModelBasePackage())) {
            throw new RuntimeException(this.handleMessage("未设置[modelBasePackage]"));
        }
        if (StringUtil.isEmpty(this.getObjectPrefix())) {
            throw new RuntimeException(this.handleMessage("未设置[objectPrefix]"));
        }
    }
}
